# coding:utf-8

# 测试目的:
#   验证多线程是否能够修改一个全局变量
import threading
class myThread(threading.Thread):
    def __init__(self, value):
        super(myThread, self).__init__()
        value += 1
        print('in myThread value=',value)


if __name__ == '__main__':
    value = 0
    threads = []

    for num in range(10):
        thread = myThread(value)
        thread.start()
        threads.append(thread)

    for thread in threads:
        thread.join()

    print(value)
